from sqlalchemy import Column, Integer, String, Float, Boolean, Date, DateTime, Time, Text, DECIMAL
from sqlalchemy.dialects.postgresql import UUID, JSON, JSONB, VARCHAR
from sqlalchemy.orm import relationship

from app.db.base_class import Base

from .archivable import Archivable
from .link import user_group_association


class Group(Base, Archivable):
    name = Column(VARCHAR)
    demo1 = Column(Integer)
    demo2 = Column(String(128))
    demo3 = Column(Float)
    demo4 = Column(Boolean)
    demo5 = Column(String(128))
    demo6 = Column(Date)
    demo7 = Column(DateTime)
    demo8 = Column(Time)
    demo9 = Column(Text)
    demo10 = Column(DECIMAL(10, 4))
    demo11 = Column(JSON)
    demo12 = Column(JSONB)
    demo13 = Column(Text)

    users = relationship(
        'User',
        secondary=user_group_association,
        back_populates="groups"
    )
